<?php

namespace app\common\model;

use think\Model;

class UserReal extends Model
{
	// 完整数据表名
	protected $table = 'user_real';

	// 获取审核列表
	public function getUserRealList()
	{	
		return $this->select();
	}
    //修改审核状态
    public function editStatus($id,$status)
    {
        $edit_data['status'] = $status;
        $edit_data['update_date'] = date('Y/m/d H:i:s');
        return $this->where('id',$id)->update($edit_data);
    }
    //删除审核记录
    public function delStatus($id)
    {
        return $this->where('id',$id)->delete();
    }
	// 插入用户数据
	public function addUserRecommend($mobile) 
	{
		$add_data['mobile'] = $mobile;
		$add_data['create_time'] = time();
		$add_data['create_date'] = date('Y/m/d');
		$this->save($add_data);

	}
    //提交实名申请
    public function addReal($data)
    {
        $add_data['user_id'] = $data['user_id'];
        $add_data['id_num'] = $data['id_num'];
        $add_data['positive'] = $data['positive'];
        $add_data['back'] = $data['back'];
        $add_data['create_date'] = date('Y-m-d H:i:s');
        return $this->save($add_data);
    }
}